package behavioral.responsibility;

/**
 * @Description: 项目经理
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class Manager extends Handler {
    public Boolean check(String reason, int days) {
        if (days <= 2 && "出去吃肉".equals(reason)) {
            System.out.println(String.format("项目经理处理【%s】：同意！食堂伙食确实不怎么样，没吃完的带回来！", reason));
            return true;
        } else if ("年假".equals(reason) || "禽流感需要隔离".equals(reason)) {
            System.out.println(String.format("项目经理处理【%s】：没问题，移交给部门领导。", reason));
            return getNextHandler().check(reason, days);
        }
        System.out.println(String.format("项目经理处理【%s】：不同意，别乱请假", reason));
        return false;
    }
}
